//
// Created by fazhehy on 2024/3/14.
//

#ifndef FPM383C_H
#define FPM383C_H

#include "common_inc.h"

#define FPM383C_UART        huart2
#define FPM383C_ENABLE      HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET)
#define FPM383C_DISABLE     HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET)
#define FPM383C_DELAY       1000

typedef enum {
    none,
    green,
    red,
    red_green,
    blue,
    red_blue,
    green_blue
}fpm383c_led_color;

void fpm383c_on();
void fpm383c_off();
void fpm383c_callback();

uint8_t fpm383c_register_fingerprint(uint8_t reg_idx);
uint8_t fpm383c_register_fingerprint_query(uint16_t * id, uint8_t * proc);
uint8_t fpm383c_check_finger(uint8_t * state);
uint8_t fpm383c_save_fingerprint(uint16_t id);
uint8_t fpm383c_save_fingerprint_query();
uint8_t fpm383c_get_fingerprint_num(uint8_t * num);
uint8_t fpm383c_clear_all();
uint8_t fpm383c_control_led(fpm383c_led_color color);
uint8_t fpm383c_match_fingerprint();
uint8_t fpm383c_match_fingerprint_query(uint16_t * id);
uint8_t fpm383c_sleep();

#endif //FPM383C_H
